LiveObjects are dynamic content that can be inserted to a EPT-document by editors using the Webitor AS-component for WYSIWYG editing. LiveObjects are very useful as they make it possible for the editors to create more complex and diverse content.

If, for example, the editor wants to create a page for Job Applications and would like the page to show the number of open position. The number of open positions must be updated automatically when the number changes. This is a typical case when LiveObjects can be used. The developers of the site can create a LiveObject that calculates the number of open positions. The LiveObject can be inserted into the page for Job Application and when requested by a visitor the LiveObject will be executed and the number of open positions will automatically be updated.

LiveObjects are similar to AS-components used by developers - both technologies execute code. The difference is that LiveObjects are embedded in EPT-documents as XML islands, while AS-components are embedded in ASPX as XML islands.

EPT and LiveObjects

LiveObjects can only be used in the AS-component Webitor. This means that LiveObjects only works for EPT-documents.

To enable the editors to insert LiveObjects, the setting for Display Object must be enabled in the AS-komponent Webitor. In the presentation template the component Insert Field with Objects must be used.

For further customization of using LiveObjects in the Webitor, the following settings can be used:

Setting Description
DefaultObjectLocation Locks the editor from changing category from which the LiveObject might be selected from.
LockObjectPosition Inserted objects cannot be moved
BypassObjectURLDialog The URL dialog for selecting an object will be bypassed. This setting is often used in combination with the DefaultObjectLocation setting.
ObjectEditingLevel Regulate how editors can use the editing capabilities of the Live Object
  • 0: Both insert and edit the settings of the LiveObjects. For customizable LiveObjects this setting means that editing is enabled both for insert and edit.
  • 1: The editor can only edit LiveObjects. Insert is disabled.
  • 2: Insert and edit are disabled.

Så fungerar LiveObjekt

LiveObjekt påminner mycket om Active Scripting. Skillnaden mot Active Scriping är att referensen till LiveObjektet (XML-ön) ersätts i presentationsmallen mha AS-komponenten Insert Field with Objects, med en en server.execute som exekvererar den URL som LiveObjektet pekar på. Om URL:en pekar på en sida med programkod är det resultatet av exekveringen som infogas. Koden infogas alltså inte i EPT dokumentet - istället infogas resultatet av exekveringen av koden.

För att infoga ett LiveObjekt krävs att redaktören har rättigheten Bläddra på webbplats. För att visa en sida som använder ett LiveObjekt krävs att besökaren har Bläddra på webbplats.

How to build Live Objects

Den enklaste formen av LiveObjekt kan liknas vid ett vanligt HTML/XHTML-dokument som infogas. I praktiken kan godtyckligt dokument i CS användas som ett LiveObjekt, men oftast är det önskvärt med dokument utan metadata. Orsaken är att om metadata genereras av LiveObjektet kommer sidan att innehålla flera metadatasektioner vilket inte är tillåtet.

Ett LiveObjekt kan innehålla statisk information (HTML/XHTML-sidor) eller dynamisk information (programkod som exekveras).

En mer komplex typ av LiveObjekt är de som försetts med inställningsmöjligheter - se Customizable Live Objects nedan.

Performance and cache

Cachning av LiveObjekt kan ske på två sätt: antingen programkoden i LiveObjektet, eller i AS-komponenten Insert Field with Objects (i presentationsmallen) vilket är det vanligaste sättet.

I AS-komponenten Insert Field with Objects finns möjlighet att cacha resultatet av LiveObjektet antingen i en Applikationscache (gemensam för alla användare) eller i en Sessionscache (unik cache för alla användare):